oo::class create Comment {
    superclass Plugin
    variable RenamedpadWidget Language

    constructor {renamedpadWidget language} {
        set RenamedpadWidget $renamedpadWidget
        set Language $language
    }

    method hilightCommentAfterInsert {index content args} {
        $Language updateComment $RenamedpadWidget $index \
            [$RenamedpadWidget index "$index +[string length $content]c"]
    }

    method hilightCommentAfterDelete {from args} {
        $Language updateComment $RenamedpadWidget $from $from
    }

    method hilightCommentAfterReplace {from to content args} {
        $Language updateComment $RenamedpadWidget $from \
            [$RenamedpadWidget index "$from +[string length $content]c"]
    }

    method getPluginEvents {} {
        return {
            {afterInsert hilightCommentAfterInsert}
            {afterDelete hilightCommentAfterDelete}
            {afterReplace hilightCommentAfterReplace}
        }
    }
}